package com.xiu.proxy;
interface IStar {
	public void sing() ;
}
class LDHStar implements IStar {

	@Override
	public void sing() {
		System.out.println("刘德华唱歌");

	}

}
public class ProxyStar implements IStar {
	// 真实对象的引用
	private IStar star;

	public ProxyStar(IStar star) {
		super();
		this.star = star;
	}

	@Override
	public void sing() {
		System.out.println("事前准备");
		star.sing();
		System.out.println("事后收尾");
	}

	public static void main(String[] args) {
		ProxyStar ps=new ProxyStar(new LDHStar());
		ps.sing();
	}
}
